# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=libavtp
pkgver=0.2.0
pkgrel=2
pkgdesc="Open source implementation of Audio Video Transport Protocol"
arch=(x86_64)
url="https://github.com/Avnu/libavtp"
license=(BSD)
makedepends=(cmocka meson)
provides=(libavtp.so)
source=($url/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
sha512sums=('b7e7cd412ce7b62b2c0908427448bc88ca3bddd18823694744a98aa9e15e4f4daa7f3621f1005642e5d3072b40dc72f234c8a3f37ef01e0ca5b2ccbc4f90d5c2')
b2sums=('a74d7ea25006aa03f4d30b47ca1a76012d3bd1ea74a33b14822fff5521f45923224a15c00a7779478008f7e12dd11575df455e7b1f08f0c83e8b7809faf60f3c')

build() {
  arch-meson build $pkgname-$pkgver
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="${pkgdir}" meson install -C build
  install -vDm 644 $pkgname-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 $pkgname-$pkgver/{CONTRIBUTING,HACKING,README}.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
